<template>
  <div class="mytable">
    <!-- 表格 -->
    <el-table
      border
      :data="businesslist"
      style="width: 100%">

      <el-table-column
        v-for="(item,index) in columns"
        :key="index"
        :prop="item.prop"
        :label="item.label"
        :formatter="item.formatter || null"
        show-overflow-tooltip
        >    
      </el-table-column>

      <el-table-column
        label="操作">
        <template slot-scope="scope">
          <!-- scope.row 当前行的 数据对象 -->
          <!-- scope.$index 当前行的 数据对象的索引 -->
          <el-button
            @click.native.prevent="deleteRow(scope.row._id)"
            type="danger"
            size="small">
            删除
          </el-button>
        </template>
      </el-table-column>
      
    </el-table>
    
    <!-- 分页 -->
    <el-pagination
      class="pagination"
      background
      layout="prev, pager, next"
      @current-change="handleCurrentChange"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
export default {
    props:['total','businesslist','handleCurrentChange','deleteRow','columns'],
    methods:{
        
    }
}
</script>

<style>

</style>